package yz.dut.edu.graduate.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yz.dut.edu.graduate.dao.History_DetailsMapper;
import yz.dut.edu.graduate.pojo.History_Details;

@Service
public class History_DishService {
    @Autowired
    History_DetailsMapper history_detailsMapper;

    public int InsertHistoryAndDish(long h_id,int d_id,int cnt){
        History_Details history_details=new History_Details();
        history_details.sethId(h_id);
        history_details.setdId(d_id);
        history_details.setQuantity(cnt);
        try{
            return history_detailsMapper.insertSelective(history_details);
        }catch (Exception e){
            e.printStackTrace();
            return -1;
        }
    }
}
